package com.lenovo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.GKeyword;
import com.lenovo.model.GTaskManage;
import com.lenovo.service.GTaskService;
@Repository
public class GTaskServiceImpl implements GTaskService {
	@Resource
	private BaseDAO dao ;
	@Override
	public List<GTaskManage> browse() {
		return dao.listAll("GTaskManage") ;
	}

	@Override
	public GTaskManage load(String id) {
		return (GTaskManage) dao.loadById(GTaskManage.class, id);
	}

	@Override
	public boolean del(String id) {
		boolean status = false;
		try{
			dao.delById(GTaskManage.class, id);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean save(GTaskManage obj) {
		boolean status = false;
		try{
			dao.save(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean update(GTaskManage obj) {
		boolean status = false;
		try{
			dao.update(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

}
